import { defineComponent } from 'vue';
import Styles from './topbar.module.scss';
import { Icon } from 'vant';
import { router } from '../../router';
import { useCurrectStdStore } from '@/domain/correction/hooks/currectStd';

export default defineComponent({
  name: 'TopBar',
  props: {
    bgColor: {
      type: String,
      default: ''
    },
    stuName: {
      type: String,
      default: '学生姓名'
    }
  },
  setup(props) {
    const currectStore = useCurrectStdStore();
    return () => (
      <div class={'h-r4.2 ' + Styles['top-bar']} style={'background:' + props.bgColor}>
        <Icon
          class={Styles['go-back']}
          name="arrow-left"
          onClick={() => {
            currectStore.state.remarkStatus = false;
          }}
        />
        <span class={Styles['stu-name']}>{props.stuName}</span>
      </div>
    );
  }
});
